package com.group02.community.controller;



import com.group02.community.entity.vo.AreaVO;
import com.group02.community.service.AreaService;
import com.group02.community.utils.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@CrossOrigin
@Api
@RequestMapping("area")
public class AreaController {
    @Autowired
    private AreaService areaService;

    @ApiOperation("获取省市区下拉框数据")
    @GetMapping("/list")
    public ResponseResult<List<AreaVO>> getAreaList(){
        return ResponseResult.ok(areaService.getAreaList());
    }




}
